/*
 * AbstractFilter.h
 *
 *  Created on: Dec 4, 2009
 */

#ifndef ABSTRACTFILTER_H_
#define ABSTRACTFILTER_H_

#include "IFilter.h"

class AbstractFilter : public IFilter {
protected:
	/*
	 * @postcondition	vectors values not changed
	 * @return new vector with filter applied
	 */
	virtual void applyFilterInVector(int width, int height, int **vectors, int **newVectors) = 0;

	/*
	 * @postcondition vectors not changed
	 * @return the up left value of vectors, [i, j] is a invalid pair is returned 1
	 */
	int getUpLeftValue(unsigned int i,
							unsigned int j,
							unsigned int maxWidth,
							unsigned int maxHeight,
							int **vectors) const;
	/*
	 * @postcondition vectors not changed
	 * @return the up center value of vectors, [i, j] is a invalid pair is returned 1
	 */
	int getUpCenterValue(unsigned int i,
							unsigned int j,
							unsigned int maxWidth,
							unsigned int maxHeight,
							int **vectors) const;

		/*
		 * @postcondition vectors not changed
		 * @return the up right value of vectors, [i, j] is a invalid pair is returned 1
		 */
		int getUpRightValue(unsigned int i,
								unsigned int j,
								unsigned int maxWidth,
								unsigned int maxHeight,
								int **vectors) const;
		/*
		 * @postcondition vectors not changed
		 * @return the center left value of vectors, [i, j] is a invalid pair is returned 1
		 */
		int getCenterLeftValue(unsigned int i,
									unsigned int j,
									unsigned int maxWidth,
									unsigned int maxHeight,
									int **vectors) const;
		/*
		 * @postcondition vectors not changed
		 * @return return the center right value of vectors, [i, j] is a invalid pair is returned 1
		 */
		int getCenterRightValue(unsigned int i,
									unsigned int j,
									unsigned int maxWidth,
									unsigned int maxHeight,
									int **vectors) const;
		/*
		 * @postcondition vectors not changed
		 * @return the down left value of vectors, [i, j] is a invalid pair is returned 1
		 */
		int getDownLeftValue(unsigned int i,
									unsigned int j,
									unsigned int maxWidth,
									unsigned int maxHeight,
									int **vectors) const;

		/*
		 * @postcondition vectors not changed
		 * @return the down center value of vectors, [i, j] is a invalid pair is returned 1
		 */
		int getDownCenterValue(unsigned int i,
									unsigned int j,
									unsigned int maxWidth,
									unsigned int maxHeight,
									int **vectors) const;

		/*
		 * @postcondition vectors not changed
		 * @return down right left value of vectors, [i, j] is a invalid pair is returned 1
		 */
		int getDownRightValue(unsigned int i,
									unsigned int j,
									unsigned int maxWidth,
									unsigned int maxHeight,
									int **vectors) const;
public:
	AbstractFilter();
	virtual ~AbstractFilter();
	virtual ImageEntity *apply(ImageEntity *originalImageEntity);

};

#endif /* ABSTRACTFILTER_H_ */
